<ion-header>
  <ion-navbar setBackButtonText=''>
    <ion-title>电梯详情</ion-title>
  </ion-navbar>
</ion-header>

<ion-content class="elevator-detail" [ngClass]="{'bg':isPassenger}">
  <div class="base">
    <div class="head" *ngIf="!isPassenger">
      <span>
        <img src="assets/icon/maince_base.png">基本信息</span>
      <span></span>
    </div>
    <div class="head2" *ngIf="isPassenger">
      <span class="bor"></span>电梯信息
    </div>
    <div class="info">
      <img src="assets/icon/maince_dtdm.png">
      <span>设备代码</span>
      <span class="last">{{elevatorIdInfo.elevatorNum}}</span>
    </div>
    <div class="info">
      <img src="assets/icon/maince_dtwz.png">
      <span>电梯位置</span>
      <span class="last">{{elevatorIdInfo.buildAddr}}</span>
    </div>

    <div class="info">
      <img src="assets/icon/maince_dtlx.png">
      <span>电梯类型</span>
      <span class="last">{{elevatorIdInfo.elevatorTypeName}}</span>
    </div>
    <div class="info">
      <img src="assets/icon/maince_wbdw.png">
      <span>使用单位</span>
      <span class="last">{{elevatorIdInfo.usedPartyName}}</span>
    </div>
    <div class="info">
      <img src="assets/icon/maince_wbdw.png">
      <span>维保单位</span>
      <span class="last">{{elevatorIdInfo.maintenancePartyName}}</span>
    </div>

    <!-- 维保次数  上次维保时间  乘客 -->
    <div class="info">
      <img src="assets/icon/maince_number.png">
      <span>制造单位</span>
      <span class="last">{{elevatorIdInfo.createCompanyName}}</span>
    </div>
    <div class="info">
      <img src="assets/icon/maince_time.png">
      <span>上次维保时间</span>
      <span class="last">{{elevatorIdInfo.lastMaintenanceTime | detailDate}}</span>
    </div>
  </div>
  <div *ngIf="!isPassenger">
    <div class="lishi">
      <div class="head" (click)="toMaince()">
        <span>
          <img src="assets/icon/detail_wbjl.png">维保记录</span>
        <span>查看更多
          <img src="assets/icon/home_enter.png">
        </span>

      </div>
      <div class="cont">
        <div class="row" *ngFor="let maintence of maintenceList">
          <div class="left">
            <span class="num">{{maintence.maintenanceStartDate | getDay}}</span>
            <span>{{maintence.maintenanceStartDate | getWeak}}</span>
            <span class="round"></span>
            <p>{{maintence.maintenanceStartDate | getYearMonth}}</p>

          </div>
          <div class="right">
            <span class="name">{{maintence.maintenanceUserName}}</span>
            <span class="btn" [ngClass]="{'a':maintence.type==1,'b':maintence.type==2,'c':maintence.type==3,'d':maintence.type==4}">
              {{maintence.type | constantTransfer:maintenceTypes}}</span>
          </div>
        </div>
        <div>
          <p style="color:#c8c7cc;text-align:center;">更多历史维保记录请登录电脑端查看</p>
        </div>
      </div>
    </div>

    <div *ngIf="!isPassenger">
      <div class="lishi">
        <div class="head" (click)="toDaily()">
          <span>
            <img src="assets/icon/detail_wbjl.png">巡检记录</span>
          <span>
            查看更多
            <img src="assets/icon/home_enter.png">
          </span>

        </div>
        <div class="cont">
          <div class="row" *ngFor="let daily of dailyList">
            <div class="left">
              <span class="num">{{daily.checkEndDt | getDay}}</span>
              <span>{{daily.checkEndDt | getWeak}}</span>
              <span class="round"></span>
              <p>{{daily.checkEndDt | getYearMonth}}</p>

            </div>
            <div class="right">
              <span class="name">{{daily.checkUserName}}</span>
              <span class="btn">
                检</span>
            </div>
          </div>
          <div>
            <p style="color:#c8c7cc;text-align:center;">更多历史巡检记录请登录电脑端查看</p>
          </div>
        </div>
      </div>
    </div>

    <div class="lishi">
      <div class="head" (click)="toRepair()">
        <span>
          <img src="assets/icon/detail_wxjl.png">维修记录</span>
        <span>查看更多
          <img src="assets/icon/home_enter.png">
        </span>

      </div>
      <div class="cont">
        <div class="row" *ngFor="let repair of repairList">
          <div class="left">
            <span class="num">{{repair.resolveDate | getDay}}</span>
            <span>{{repair.resolveDate | getWeak}}</span>
            <span class="round borblue"></span>
            <p>{{repair.resolveDate | getYearMonth}}</p>

          </div>
          <div class="right">
            <span class="text">
              {{repair.faultDescription}}
            </span>
            <span class="btn a">
              修</span>
          </div>
        </div>
        <div>
          <p style="color:#c8c7cc;text-align:center;">更多历史维修记录请登录电脑端查看</p>
        </div>
      </div>
    </div>
  </div>
  <div class="bootom" *ngIf="isPassenger">
    <div>
      <img src="assets/icon/miance_feedback.png" alt="" (click)="toFeedback()">
      <p>乘坐反馈</p>
    </div>
    <div>
      <img src="assets/icon/maince_phone.png" alt="" (click)="doCall()">
      <p>救援电话</p>
    </div>
  </div>

</ion-content>

<ion-footer *ngIf="!isPassenger">
  <div *ngIf="showToWork" class="signbtndiv">
    <!-- <button (click)="toSign()"> <img src="assets/icon/detail_qd.png">去签到</button> -->
    <button (click)="goWork()">
      <img src="assets/icon/detail_qd.png">去工作</button>
  </div>
</ion-footer>